<?php

class Favorite extends AppModel {

  var $name = "Favorite";
  
  var $belongsTo = array(
		'Product'=>array('foreignKey' => 'product_id'), 
		'Member'=>array('foreignKey' => "member_id"),
    );
    
  function isFavorite($p, $m) {
  	return ($this->find('count', array('conditions' => array('Favorite.product_id' => $p, 'Favorite.member_id' => $m))));
  }

}

?>
